package com.world.wifi.service.impl;

import java.util.List;
import com.world.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.world.wifi.mapper.WifiNetworkDeviceMapper;
import com.world.wifi.domain.WifiNetworkDevice;
import com.world.wifi.service.IWifiNetworkDeviceService;

/**
 * 网络设备Service业务层处理
 * 
 * @author LiJunXi
 * @date 2025-05-27
 */
@Service
public class WifiNetworkDeviceServiceImpl implements IWifiNetworkDeviceService 
{
    @Autowired
    private WifiNetworkDeviceMapper wifiNetworkDeviceMapper;

    /**
     * 查询网络设备
     * 
     * @param deviceId 网络设备主键
     * @return 网络设备
     */
    @Override
    public WifiNetworkDevice selectWifiNetworkDeviceByDeviceId(Long deviceId)
    {
        return wifiNetworkDeviceMapper.selectWifiNetworkDeviceByDeviceId(deviceId);
    }

    /**
     * 查询网络设备列表
     * 
     * @param wifiNetworkDevice 网络设备
     * @return 网络设备
     */
    @Override
    public List<WifiNetworkDevice> selectWifiNetworkDeviceList(WifiNetworkDevice wifiNetworkDevice)
    {
        return wifiNetworkDeviceMapper.selectWifiNetworkDeviceList(wifiNetworkDevice);
    }

    /**
     * 新增网络设备
     * 
     * @param wifiNetworkDevice 网络设备
     * @return 结果
     */
    @Override
    public int insertWifiNetworkDevice(WifiNetworkDevice wifiNetworkDevice)
    {
        wifiNetworkDevice.setCreateTime(DateUtils.getNowDate());
        return wifiNetworkDeviceMapper.insertWifiNetworkDevice(wifiNetworkDevice);
    }

    /**
     * 修改网络设备
     * 
     * @param wifiNetworkDevice 网络设备
     * @return 结果
     */
    @Override
    public int updateWifiNetworkDevice(WifiNetworkDevice wifiNetworkDevice)
    {
        return wifiNetworkDeviceMapper.updateWifiNetworkDevice(wifiNetworkDevice);
    }

    /**
     * 批量删除网络设备
     * 
     * @param deviceIds 需要删除的网络设备主键
     * @return 结果
     */
    @Override
    public int deleteWifiNetworkDeviceByDeviceIds(Long[] deviceIds)
    {
        return wifiNetworkDeviceMapper.deleteWifiNetworkDeviceByDeviceIds(deviceIds);
    }

    /**
     * 删除网络设备信息
     * 
     * @param deviceId 网络设备主键
     * @return 结果
     */
    @Override
    public int deleteWifiNetworkDeviceByDeviceId(Long deviceId)
    {
        return wifiNetworkDeviceMapper.deleteWifiNetworkDeviceByDeviceId(deviceId);
    }
}
